/*! * stui v3.0 copyright 2016-2018 http://v.shoutu.cn * email 726662013@qq.com,admin@shoutu.cn */ var stui = { 'browser': {//浏览器 url: document.url, domain: document.domain, title: document.title, language: (navigator.browserlanguage || navigator.language).tolowercase(), canvas: function() { return !!document.createelement("canvas").getcontext }(), useragent: function() { var a = navigator.useragent; return { mobile: !! a.match(/applewebkit.*mobile.*/), ios: !! a.match(/\(i[^;]+;( u;)? cpu.+mac os x/), android: -1 < a.indexof("android") || -1 < a.indexof("linux"), iphone: -1 < a.indexof("iphone") || -1 < a.indexof("mac"), ipad: -1 < a.indexof("ipad"), trident: -1 < a.indexof("trident"), presto: -1 < a.indexof("presto"), webkit: -1 < a.indexof("applewebkit"), gecko: -1 < a.indexof("gecko") && -1 == a.indexof("khtml"), weixin: -1 < a.indexof("micromessenger") } }() }, 'images': {//图片处理 'lazyload': function() { $(".lazyload").lazyload({ effect: "fadein", threshold: 200, failurelimit: 15, skip_invisible: false }) }, 'qrcode': function() { $("img.qrcode").attr("src", "https://api.qrserver.com/v1/create-qr-code/?size=180x180&data=" + encodeuricomponent(stui.browser.url) + ""); } }, 'common': {//公共基础 'tab': function() { $(".tab li").on('click',function(){ $(".tab li.active").removeclass('active'); $(this).addclass('active'); var index = $(this).index(); $(".tab-content .item").eq(index).addclass('active').siblings().removeclass('active'); }); $(".down-tab li").on('click',function(){ $(".down-tab li.active").removeclass('active'); $(this).addclass('active'); var index = $(this).index(); $(this).parent().parent().find("h3").html($(".down-tab li.active").html()); $(".down-content .down-item").eq(index).addclass('active').siblings().removeclass('active'); $(".down-tab").hide(); }); $(".play-tab li").on('click',function(){ $(".play-tab li.active").removeclass('active'); $(this).addclass('active'); var index = $(this).index(); $(this).parent().parent().find("h3").html($(".play-tab li.active").html()) $(".play-content .play-item").eq(index).addclass('active').siblings().removeclass('active'); $(".play-tab").hide(); }); $(".play-switch").on('click',function(){ $(".play-tab").toggle(); }); $(".down-switch").on('click',function(){ $(".down-tab").toggle(); }); }, 'history': function() { if($.cookie("recente")){ var json=eval("("+$.cookie("recente")+")"); var list=""; for(i=0;i"+json[i].vod_part+""+json[i].vod_name+""; } $("#stui_history").append(list); } else $("#stui_history").append("

您还没有看过影片哦

"); $(".historyclean").on("click",function(){ $.cookie("recente",null,{expires:-1,path: '/'}); }) }, 'collapse': function() { $("a.detail-more").on("click",function(){ $(this).parent().find(".detail-sketch").addclass("hide"); $(this).parent().find(".detail-content").css("display",""); $(this).remove(); }) }, 'more': function() { $(".menu-switch").on('click',function(){ var display = playside.css('display'); if(display == 'block'){ playside.hide(); playleft.css("width","100%"); $(this).find("span").html("打开菜单"); }else{ playside.show(); playleft.css("width","75%"); $(this).find("span").html("关闭菜单"); } }) $(".open-desc").on('click',function(){ $(".data-more").slidetoggle("slow") }) var date = new date; var h = date.gethours(); //时 var minute = date.getminutes() //分 if(h<10){ h = "0"+h; } if(minute<10){ minute = "0"+minute; } $(".date").html(''+h+":"+minute+""); } } }; $(document).ready(function() { stui.images.lazyload(); stui.images.qrcode(); stui.common.tab(); stui.common.history(); stui.common.collapse(); stui.common.more(); });